﻿using System;
using System.Collections.Generic;
using System.Drawing.Printing;
using System.Linq;
using System.Security.Policy;
using System.Web;
using System.Web.Mvc;
using ZQNB.Common.FileDbs;
using ZQNB.Common.Ioc;
using ZQNB.Common.Logs;
using ZQNB.Common.Serialize;
using ZQNB.Web.Common.Contexts;
using ZQNB.Web.Common.Security;

namespace ZQNB.Web.Controllers
{
    public class HomeController : Controller
    {
        public ActionResult Index()
        {
            return View();
        }

        public ActionResult Demo()
        {
            return View();
        }


        public ActionResult Log(int size = 1)
        {
            string message = string.Format("{0}-{1}", DateTime.Now, " this is a log ");
            if (size >= 1)
            {
                for (int i = 0; i < size; i++)
                {
                    string mark = string.Format("{0}/{1} ", i, size);
                    SaveLog(message + mark);
                }
            }
            ViewBag.Message = message;
            return View();
        }

        private void SaveLog(string message)
        {
            ILogger logger = this.GetLogger();
            logger.Debug(message);
        }

        public class Hello
        {
            public Guid Id { get; set; }
            public string Name { get; set; }
        }


        public ActionResult RouteTest()
        {
            return View();
        }
    }
}